Figment
Figment is a semi-hierarchical configuration library for Rust so con-free, it's unreal.
use Deserialize;
use ;
let config: Config = new
.merge
.merge
.merge
.join
.extract?;
See the documentation for a detailed usage guide and information.
Usage
Add the following to your Cargo.toml
, enabling the desired built-in providers:
[]
= { = "0.10", = ["toml", "env"] }
Third-Party Providers
The following external libraries implement Figment providers:
-
Wraps existing providers. For any key ending in
_FILE
(configurable), emits a key without the_FILE
suffix with a value corresponding to the contents of the file whose path is the original key's value.
Please submit a pull request to add your library to this list.
License
Figment is licensed under either of the following, at your option:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)